package com.neusoft.databus.policy.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import lombok.Getter;
import lombok.Setter;

/**
 * 策略配置，容错，复杂告警，通讯中断
 *
 * @author naxiang
 */
@Getter
@Setter
@Component
@ConfigurationProperties(prefix = "databus.policy.properties", ignoreUnknownFields = false)
public class DatabusPolicyProperties {
    /**
     * 表达式业务判断线程数
     */
    private Integer expressionHandlerThreadSize = 16;
    /**
     * 表达式业务判断最大线程数
     */
    private Integer expressionHandlerThreadMaxSize = 32;
    /**
     * 表达式业务判断线程空闲时间
     */
    private Integer expressionHandlerKeepAliveTime = 10;

    /**
     * complex表达式业务判断线程数
     */
    private Integer complexExpressionHandlerThreadSize = 8;
    /**
     * complex表达式业务判断最大线程数
     */
    private Integer complexExpressionHandlerThreadMaxSize = 16;

    /**
     * complex表达式业务判断线程空闲时间
     */
    private Integer complexExpressionHandlerKeepAliveTime = 10;
    /**
     * 当次中断告警触发时间距离上次触发告警时间在该时间内的话，将被忽视，不认为是中断告警
     */
    private Integer interruptIgnoreInterval = 120000;
    /**
     * 当次中断告警触发时间距离上次触发告警时间大于该时间的话，默认为首次中断告警
     */
    private Integer interruptIgnoreFarAferinterval = 3600000;
    /**
     * 部署各个服务之间允许的时间误差
     */
    private Integer toleratedMistakeTimeBetweenServices = 30000;
    /**
     * 超过时间误差的数据，是否推送到客户端
     */
    private Boolean pushRealtimeDataWhenMistakeHappend = false;
    /**
     * 是否启用复杂策略
     */
    private Boolean complexPolicy = false;

}
